﻿using System.Runtime;
using System.Globalization;

namespace System.Reflection
{
    [NonScript]
    public abstract class PropertyInfo : MemberInfo
    {
        public override MemberTypes MemberType
        {
            get { return MemberTypes.Property; }
        }

        public abstract Type PropertyType { get; }

        public abstract PropertyAttributes Attributes { get; }

        public abstract bool CanRead { get; }

        public abstract bool CanWrite { get; }

        public virtual MethodInfo GetMethod
        {
            [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
            get { return this.GetGetMethod(true); }
        }

        public virtual MethodInfo SetMethod
        {
            [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
            get { return this.GetSetMethod(true); }
        }

        public bool IsSpecialName
        {
            get { return false; }
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        protected PropertyInfo()
        {
        }


        public static bool operator ==(PropertyInfo left, PropertyInfo right)
        {
            return false;
        }


        [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
        public static bool operator !=(PropertyInfo left, PropertyInfo right)
        {
            return !(left == right);
        }

        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public virtual object GetConstantValue()
        {
            return 0;
        }

        public virtual object GetRawConstantValue()
        {
            return 0;
        }

        public abstract void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);

        public abstract MethodInfo[] GetAccessors(bool nonPublic);

        public abstract MethodInfo GetGetMethod(bool nonPublic);

        public abstract MethodInfo GetSetMethod(bool nonPublic);

        public abstract ParameterInfo[] GetIndexParameters();

        public object GetValue(object obj)
        {
            return this.GetValue(obj, null);
        }

        public virtual object GetValue(object obj, object[] index)
        {
            return null;
        }

        public abstract object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);

        public void SetValue(object obj, object value)
        {
        }

        public virtual void SetValue(object obj, object value, object[] index)
        {
        }

        public virtual Type[] GetRequiredCustomModifiers()
        {
            return new Type[0];
        }

        public virtual Type[] GetOptionalCustomModifiers()
        {
            return new Type[0];
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public MethodInfo[] GetAccessors()
        {
            return null;
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public MethodInfo GetGetMethod()
        {
            return null;
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public MethodInfo GetSetMethod()
        {
            return null;
        }
    }
}
